package com.giscloud.limp.entity;
import java.io.Serializable;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.util.ArrayList;
import java.util.Arrays;
/**
 * 案件结案信息
 * 
 * @author giscloud
 * @email giscloud@giscloud.com
 * @date 2020-07-07 11:22:55
 */
@Data
public class CaseClose implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 * 案件结案ID
	 */
   private Integer caseCloseId;
	/**
	 * 案件ID
	 */
   private Integer caseId;
	/**
	 * 结案类型 1|和解;2|撤诉;3|调解;4|判决
	 */
   private Integer closecaseType;
	/**
	 * 结案阶段 1|诉讼结案;2|审理结案
	 */
   private Integer closecaseStage;
	/**
	 * 结案说明
	 */
   private String closecaseDescription;
	/**
	 * 结案附件
	 */
   private String attachmentId;
	/**
	 * 结案附件收到时间
	 */
	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
   private Date attachmentReceiveDate;
	/**
	 * 其它附件
	 */
   private String otherAttachmentId;
	/**
	 * 状态
	 */
   private Integer statusCd;
	/**
	 * 创建人ID
	 */
   private Integer createdStaffId;
	/**
	 * 创建时间
	 */
	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
   private Date createdDt;
	/**
	 * 修改人
	 */
   private Integer operateStaffId;
	/**
	 * 修改时间
	 */
   private Date version;
	/**
	 * 结案日期
	 */
	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
   private Date closecaseDate;
	/**
	 * 决议附件
	 */
   private String resolutionAttachment;

	/**
	 * 提醒日期
	 */
	private Date warnDate;
	/**
	 * 提醒内容
	 */
	private String warnContent;

public enum Column {
						caseCloseId("case_close_id","caseCloseId","INTEGER",false),
								caseId("case_id","caseId","INTEGER",false),
								closecaseType("closecase_type","closecaseType","INTEGER",false),
								closecaseStage("closecase_stage","closecaseStage","INTEGER",false),
								closecaseDescription("closecase_description","closecaseDescription","VARCHAR",false),
								attachmentId("attachment_id","attachmentId","VARCHAR",false),
								attachmentReceiveDate("attachment_receive_date","attachmentReceiveDate","DATE",false),
								otherAttachmentId("other_attachment_id","otherAttachmentId","VARCHAR",false),
								statusCd("status_cd","statusCd","INTEGER",false),
								createdStaffId("created_staff_id","createdStaffId","INTEGER",false),
								createdDt("created_dt","createdDt","TIMESTAMP",false),
								operateStaffId("operate_staff_id","operateStaffId","INTEGER",false),
								version("version","version","TIMESTAMP",false),
								closecaseDate("closecase_date","closecaseDate","DATE",false),
								resolutionAttachment("resolution_attachment","resolutionAttachment","VARCHAR",false);
	    		private static final String BEGINNING_DELIMITER = "`";
	private static final String ENDING_DELIMITER = "`";
	private final String column;
	private final boolean isColumnNameDelimited;
	private final String javaProperty;
	private final String jdbcType;
	public String value() {
		return this.column;
	}
	public String getValue() {
		return this.column;
	}
	public String getJavaProperty() {
		return this.javaProperty;
	}
	public String getJdbcType() {
		return this.jdbcType;
	}
	Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) {
		this.column = column;
		this.javaProperty = javaProperty;
		this.jdbcType = jdbcType;
		this.isColumnNameDelimited = isColumnNameDelimited;
	}
	public String desc() {
		return this.getEscapedColumnName() + " DESC";
	}
	public String asc() {
		return this.getEscapedColumnName() + " ASC";
	}
	public static Column[] excludes(Column ... excludes) {
		ArrayList<Column> columns = new ArrayList<>(Arrays.asList(Column.values()));
		if (excludes != null && excludes.length > 0) {
			columns.removeAll(new ArrayList<>(Arrays.asList(excludes)));
		}
		return columns.toArray(new Column[]{});
	}
	public String getEscapedColumnName() {
		if (this.isColumnNameDelimited) {
			return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString();
		} else {
			return this.column;
		}
	}
	public String getAliasedEscapedColumnName() {
		return this.getEscapedColumnName();
	}
  }

}
